<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>OpenShoe: control_tables.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenShoe
   &#160;<span id="projectnumber">1.0</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">control_tables.h</div>  </div>
</div>
<div class="contents">
<a href="control__tables_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00002"></a>00002 
<a name="l00026"></a>00026 <span class="preprocessor">#ifndef CONTROL_TABLES_H_</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define CONTROL_TABLES_H_</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;compiler.h&quot;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="nav__types_8h.html">nav_types.h</a>&quot;</span>
<a name="l00032"></a>00032 
<a name="l00034"></a><a class="code" href="structcommand__structure.html">00034</a> <span class="keyword">typedef</span> <span class="keyword">const</span> <span class="keyword">struct </span>{
<a name="l00035"></a><a class="code" href="structcommand__structure.html#a448f375c590f94439eeed8c3287a1119">00035</a>         uint8_t <a class="code" href="structcommand__structure.html#a448f375c590f94439eeed8c3287a1119">header</a>;
<a name="l00036"></a><a class="code" href="structcommand__structure.html#aebeb85ab86cf52981c2294e0ff785717">00036</a>         void (*cmd_response)(uint8_t**);
<a name="l00037"></a><a class="code" href="structcommand__structure.html#a4e170d613deb0c63c5f6053aa4dfc257">00037</a>         uint8_t <a class="code" href="structcommand__structure.html#a4e170d613deb0c63c5f6053aa4dfc257">nrb_payload</a>;
<a name="l00038"></a><a class="code" href="structcommand__structure.html#a6ea64013ccdb9f90c0b39d9103c93892">00038</a>         uint8_t <a class="code" href="structcommand__structure.html#a6ea64013ccdb9f90c0b39d9103c93892">nr_fields</a>;
<a name="l00039"></a><a class="code" href="structcommand__structure.html#ac385bdc4001624f566e66b09e7dedcd3">00039</a>         uint8_t field_widths[];
<a name="l00040"></a>00040 } <a class="code" href="structcommand__structure.html" title="Definition structure of commands.">command_structure</a>;
<a name="l00041"></a>00041 
<a name="l00043"></a><a class="code" href="structproc__func__info.html">00043</a> <span class="keyword">typedef</span> <span class="keyword">const</span> <span class="keyword">struct </span>{
<a name="l00044"></a><a class="code" href="structproc__func__info.html#a133713acbe60983f171f71e2d81fae3f">00044</a>         uint8_t <a class="code" href="structproc__func__info.html#a133713acbe60983f171f71e2d81fae3f">id</a>;
<a name="l00045"></a><a class="code" href="structproc__func__info.html#ab0d228e3d6f56666fb9d9bf0f25f8d7b">00045</a>         void (*func_p)(void);
<a name="l00046"></a><a class="code" href="structproc__func__info.html#a128ad5d7538eef603b5f0dab9c42174b">00046</a>         <span class="keywordtype">int</span> <a class="code" href="structproc__func__info.html#a128ad5d7538eef603b5f0dab9c42174b">max_proc_time</a>; 
<a name="l00047"></a>00047 } <a class="code" href="structproc__func__info.html" title="Information struct for processing functions.">proc_func_info</a>;
<a name="l00048"></a>00048 
<a name="l00050"></a><a class="code" href="structstate__t__info.html">00050</a> <span class="keyword">typedef</span> <span class="keyword">const</span> <span class="keyword">struct </span>{
<a name="l00051"></a><a class="code" href="structstate__t__info.html#ae955a81f5474b2457a6aa82ea183eab8">00051</a>         uint8_t <a class="code" href="structstate__t__info.html#ae955a81f5474b2457a6aa82ea183eab8">id</a>;
<a name="l00052"></a><a class="code" href="structstate__t__info.html#abf22bd945b57e8c3317a73c618f13aca">00052</a>         <span class="keywordtype">void</span>* <a class="code" href="structstate__t__info.html#abf22bd945b57e8c3317a73c618f13aca">state_p</a>;
<a name="l00053"></a><a class="code" href="structstate__t__info.html#a8831bb5e2e85d6aa8906e984c60c354e">00053</a>         <span class="keywordtype">int</span> <a class="code" href="structstate__t__info.html#a8831bb5e2e85d6aa8906e984c60c354e">state_size</a>;
<a name="l00054"></a>00054 } <a class="code" href="structstate__t__info.html" title="State data type information struct.">state_t_info</a>;
<a name="l00055"></a>00055 
<a name="l00056"></a>00056 
<a name="l00059"></a>00059 
<a name="l00060"></a><a class="code" href="group__control__tables.html#gac644d2e05254dadd0b19a93c12c0afd9">00060</a> <span class="preprocessor">#define UPDATE_BUFFER 0x04</span>
<a name="l00061"></a><a class="code" href="group__control__tables.html#ga88f8e60882c5d69d913d1b616687465d">00061</a> <span class="preprocessor"></span><span class="preprocessor">#define INITIAL_ALIGNMENT 0x05</span>
<a name="l00062"></a><a class="code" href="group__control__tables.html#gaec182aad2e49484d086d38c7ed1f9fe4">00062</a> <span class="preprocessor"></span><span class="preprocessor">#define MECHANIZATION 0x06</span>
<a name="l00063"></a><a class="code" href="group__control__tables.html#ga72e2455cf02251f80606a36183764cd1">00063</a> <span class="preprocessor"></span><span class="preprocessor">#define TIME_UPDATE 0x07</span>
<a name="l00064"></a><a class="code" href="group__control__tables.html#ga2ea883c0ff4e6a5d37f32290ab3524b7">00064</a> <span class="preprocessor"></span><span class="preprocessor">#define ZUPT_DETECTOR 0x08</span>
<a name="l00065"></a><a class="code" href="group__control__tables.html#ga7d004ff741f1e7caad510eaa0a548fc1">00065</a> <span class="preprocessor"></span><span class="preprocessor">#define ZUPT_UPDATE 0x09</span>
<a name="l00066"></a><a class="code" href="group__control__tables.html#ga5f00f42fc2574820abde7c7dd797a036">00066</a> <span class="preprocessor"></span><span class="preprocessor">#define GYRO_CALIBRATION 0x10</span>
<a name="l00067"></a><a class="code" href="group__control__tables.html#ga8b4361d794c38610770d0078d5a581f3">00067</a> <span class="preprocessor"></span><span class="preprocessor">#define ACCELEROMETER_CALIBRATION 0x11</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span>
<a name="l00069"></a>00069 
<a name="l00072"></a>00072 
<a name="l00073"></a>00073 <span class="comment">// Maximum value of state ID (255)</span>
<a name="l00074"></a><a class="code" href="group__control__tables.html#gaeadb9947c80d097da4413c55179afe6f">00074</a> <span class="preprocessor">#define SID_LIMIT 0xFF</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span><span class="comment">// State IDs</span>
<a name="l00076"></a>00076 <span class="comment">// IMU measurements</span>
<a name="l00077"></a><a class="code" href="group__control__tables.html#gae04e393e8b250dad55fddb546ef61111">00077</a> <span class="preprocessor">#define SPECIFIC_FORCE_SID 0x01</span>
<a name="l00078"></a><a class="code" href="group__control__tables.html#ga4bae6e7de487043575d61cb52dff4cf3">00078</a> <span class="preprocessor"></span><span class="preprocessor">#define ANGULAR_RATE_SID 0x02</span>
<a name="l00079"></a><a class="code" href="group__control__tables.html#gad5186a188194306bbc87ddddc7644ddd">00079</a> <span class="preprocessor"></span><span class="preprocessor">#define IMU_TEMPERATURS_SID 0x03</span>
<a name="l00080"></a><a class="code" href="group__control__tables.html#gad0a37f572243f76ea1f2b79fc14b2a30">00080</a> <span class="preprocessor"></span><span class="preprocessor">#define IMU_SUPPLY_VOLTAGE_SID 0x04</span>
<a name="l00081"></a>00081 <span class="preprocessor"></span><span class="comment">// Filtering states</span>
<a name="l00082"></a><a class="code" href="group__control__tables.html#gaafd3e23709eecfd5bfdc358f8a07b991">00082</a> <span class="preprocessor">#define POSITION_SID 0x11</span>
<a name="l00083"></a><a class="code" href="group__control__tables.html#ga6b3256a3e116aaefe13352f9b493c279">00083</a> <span class="preprocessor"></span><span class="preprocessor">#define VELOCITY_SID 0x12</span>
<a name="l00084"></a><a class="code" href="group__control__tables.html#gae1fc29b0358f36a68b7ba9bde85e16fd">00084</a> <span class="preprocessor"></span><span class="preprocessor">#define QUATERNION_SID 0x13</span>
<a name="l00085"></a><a class="code" href="group__control__tables.html#ga1c2e91b10f17814f52bf09f647909d83">00085</a> <span class="preprocessor"></span><span class="preprocessor">#define ZUPT_SID 0x14</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span><span class="comment">// System states</span>
<a name="l00087"></a><a class="code" href="group__control__tables.html#gab3382d5f9c6e647fc9b795596dd14646">00087</a> <span class="preprocessor">#define INTERRUPT_COUNTER_SID 0x21</span>
<a name="l00088"></a>00088 <span class="preprocessor"></span><span class="comment">// &quot;Other&quot; states</span>
<a name="l00089"></a><a class="code" href="group__control__tables.html#gaf0c693bf22229a5eba03b2bad37b07bf">00089</a> <span class="preprocessor">#define ACCELEROMETER_BIASES_SID 0x35</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span>
<a name="l00091"></a>00091 
<a name="l00094"></a>00094 
<a name="l00095"></a><a class="code" href="group__control__tables.html#gac08e4ee0ee7d39737aad3c8f0345125f">00095</a> <span class="preprocessor">#define ONLY_ACK 0x01</span>
<a name="l00096"></a><a class="code" href="group__control__tables.html#ga6b19b2455c7df9d39618ea3a8b76862f">00096</a> <span class="preprocessor"></span><span class="preprocessor">#define MCU_ID 0x02</span>
<a name="l00097"></a><a class="code" href="group__control__tables.html#gac99194fc1af41c8aa6d9efd08ede1f22">00097</a> <span class="preprocessor"></span><span class="preprocessor">#define OUTPUT_STATE 0x20</span>
<a name="l00098"></a><a class="code" href="group__control__tables.html#gae0b2c5c10091e2d401594f7b1ca994bd">00098</a> <span class="preprocessor"></span><span class="preprocessor">#define OUTPUT_ALL_OFF 0x21</span>
<a name="l00099"></a><a class="code" href="group__control__tables.html#ga237ed802e40a56c4819fae1c02bb0ef2">00099</a> <span class="preprocessor"></span><span class="preprocessor">#define OUTPUT_ONOFF_INERT 0x22</span>
<a name="l00100"></a><a class="code" href="group__control__tables.html#gaa36cf28d2178f23468bb7d841ef2751c">00100</a> <span class="preprocessor"></span><span class="preprocessor">#define OUTPUT_POSITION_PLUS_ZUPT 0x23</span>
<a name="l00101"></a><a class="code" href="group__control__tables.html#ga0c9de18d6dd10a57ecac1e77ea348070">00101</a> <span class="preprocessor"></span><span class="preprocessor">#define OUTPUT_NAVIGATIONAL_STATES 0x24</span>
<a name="l00102"></a><a class="code" href="group__control__tables.html#ga4a949ef22a9067dfeab6d8a1f5dcdcb2">00102</a> <span class="preprocessor"></span><span class="preprocessor">#define PROCESSING_FUNCTION_ONOFF 0x30</span>
<a name="l00103"></a><a class="code" href="group__control__tables.html#gafcdf5f9fe1453405ee1fa33d809a0e33">00103</a> <span class="preprocessor"></span><span class="preprocessor">#define RESET_ZUPT_AIDED_INS 0x10</span>
<a name="l00104"></a><a class="code" href="group__control__tables.html#gaf9005cd230f9c8b3987cad4597a80d3f">00104</a> <span class="preprocessor"></span><span class="preprocessor">#define GYRO_CALIBRATION_INIT 0x11</span>
<a name="l00105"></a><a class="code" href="group__control__tables.html#ga4fa18373c8638280f359f99358fcc685">00105</a> <span class="preprocessor"></span><span class="preprocessor">#define ACC_CALIBRATION_INIT 0x12</span>
<a name="l00106"></a><a class="code" href="group__control__tables.html#ga8bcc9a14d954ffead9edfa80f68dc99c">00106</a> <span class="preprocessor"></span><span class="preprocessor">#define SET_LOWPASS_FILTER_IMU 0x13</span>
<a name="l00107"></a><a class="code" href="group__control__tables.html#gadd0f9ff2a48d64e6b6fde44116089531">00107</a> <span class="preprocessor"></span><span class="preprocessor">#define ADD_SYNC_OUTPUT 0x25</span>
<a name="l00108"></a><a class="code" href="group__control__tables.html#ga6a4fabc408d6210436da0220b2e92ae0">00108</a> <span class="preprocessor"></span><span class="preprocessor">#define SYNC_OUTPUT 0x26</span>
<a name="l00109"></a>00109 <span class="preprocessor"></span>
<a name="l00110"></a>00110 
<a name="l00111"></a>00111 <span class="comment">// Global variables used to access command information</span>
<a name="l00112"></a>00112 <span class="keyword">extern</span> uint8_t <a class="code" href="group__control__tables.html#gad95e17426b114a04135420ae71fad638">command_header_table</a>[32];
<a name="l00113"></a>00113 <span class="keyword">extern</span> <a class="code" href="structcommand__structure.html" title="Definition structure of commands.">command_structure</a>* <a class="code" href="group__control__tables.html#ga787ed232eeca1469a58bea3d268f1ba4">command_info_array</a>[256];
<a name="l00114"></a>00114 <span class="keywordtype">void</span> <a class="code" href="group__control__tables.html#ga3e9ed14716fd984977306110fbf28de0">commands_init</a>(<span class="keywordtype">void</span>);
<a name="l00115"></a>00115 
<a name="l00116"></a><a class="code" href="group__control__tables.html#ga93c567d32019e258ebc253b37fabde6c">00116</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__control__tables.html#ga93c567d32019e258ebc253b37fabde6c">is_valid_header</a>(uint8_t header){
<a name="l00117"></a>00117         <span class="keywordflow">return</span> <a class="code" href="group__control__tables.html#gad95e17426b114a04135420ae71fad638">command_header_table</a>[header&gt;&gt;3] &amp; (1&lt;&lt;(header &amp; 7));}
<a name="l00118"></a>00118         
<a name="l00119"></a><a class="code" href="group__control__tables.html#ga95d9006725f04b028d795b3a3d9b4572">00119</a> <span class="keyword">inline</span> <a class="code" href="structcommand__structure.html" title="Definition structure of commands.">command_structure</a>* <a class="code" href="group__control__tables.html#ga95d9006725f04b028d795b3a3d9b4572">get_command_info</a>(uint8_t header){
<a name="l00120"></a>00120         <span class="keywordflow">return</span> command_info_array[header];}
<a name="l00121"></a>00121 
<a name="l00122"></a>00122 
<a name="l00123"></a>00123 <span class="comment">// Array containing the processing functions to run</span>
<a name="l00124"></a>00124 <span class="keyword">extern</span> <a class="code" href="structproc__func__info.html" title="Information struct for processing functions.">proc_func_info</a>* <a class="code" href="group__control__tables.html#ga71b229d28824a0096f4f05aed00960a0">processing_functions_by_id</a>[256];
<a name="l00125"></a>00125 <span class="keywordtype">void</span> <a class="code" href="group__control__tables.html#gab9fa06115589056892bdb7bb02b138c8">processing_functions_init</a>(<span class="keywordtype">void</span>);
<a name="l00126"></a>00126 
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 <span class="comment">// Global variables used to access information about states</span>
<a name="l00129"></a>00129 <span class="keyword">extern</span> <a class="code" href="structstate__t__info.html" title="State data type information struct.">state_t_info</a>* <a class="code" href="group__control__tables.html#gac88bd7197a23c03d99042566d75f3884">state_info_access_by_id</a>[<a class="code" href="group__control__tables.html#gaeadb9947c80d097da4413c55179afe6f">SID_LIMIT</a>];
<a name="l00130"></a>00130 <span class="keywordtype">void</span> <a class="code" href="group__control__tables.html#gae8c28d3d1938044d7d44c2e587542ff0">system_states_init</a>(<span class="keywordtype">void</span>);
<a name="l00131"></a>00131 
<a name="l00132"></a>00132 
<a name="l00133"></a>00133 <span class="preprocessor">#endif </span><span class="comment">/* CONTROL_TABLES_H_ */</span>
<a name="l00134"></a>00134 
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Dec 20 2011 12:12:36 for OpenShoe by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
